<template>
	<view class="main">
		<view class="content">
			<view class="logo">
				<image style="width: 100%;height: 100%;" src=""></image>
			</view>
			<view class="nickname">
				昵称
			</view>
			<u-input v-model="name" class="nicknameipt" type="text" />
		</view>
		<view class="footer">
			<button class="footer_btn" @click="loginbtn">登录</button>
		</view>
	</view>
</template>

<script>
import { getcode } from "@/api/feixiang/application.js"
import { setToken } from "@/utils/auth.js"
export default {
	data() {
		return {
			name: '',
		}
	},
	onLoad() {

	},
	methods: {
		async loginbtn() {
			// console.log(this.name);
			const res = await getcode()
			// console.log(res.data.token);
			setToken(res.data.token)
			// 获取成功跳转到主页
			if (res.data.token) {
				uni.switchTab({
					url: "/pages/feixiangCaringVersion/user/user"
				})
			}
			// 微信登录获取code
			// uni.login({
			//   provider: 'weixin',
			//   onlyAuthorize:true,
			//   success: function (res) {
			//     console.log(res.code);
			//   }
			// });
		}
	}
}
</script>

<style scoped>
* {
	box-sizing: border-box;
}

.footer {
	background-color: #fff;
	position: fixed;
	bottom: 68rpx;
	width: 100%;
}

.footer_btn {
	width: 654rpx;
	height: 100rpx;
	border-radius: 16px;
	background-color: #00bcb2;
	color: #fff;
}

.logo {
	width: 208rpx;
	height: 208rpx;
	margin-left: 50%;
	/* background-color: #8df; */
	transform: translateX(-50%);
	border-radius: 16rpx;
	overflow: hidden;
}

.nickname {
	font-size: 36rpx;
	margin-bottom: 32rpx;
}

.content {
	padding: 0 48rpx;
}

.nicknameipt {
	height: 108rpx;
}
</style>